<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            background: inherit;
        }
    </style>
</head>

<body>
    <script>
        function createObject(obj) {
            function F() { }
            F.prototype = obj
            return new F()
        }
        function inherit(subType, superType) {
            subType.prototype = createObject(superType.prototype)
            Object.defineProperty(subType.prototype, 'constructor', {
                enumerable: false,
                value: subType,
                configurable: true,
                writable: true
            })
        }
        function Person(name, age, height) {
            this.name = name
            this.age = age
            this.height = height
        }
        Person.prototype.running = function () {
            console.log(this.name, '在跑步');
        }
        function Student(name, age, height, sno) {
            Person.call(this, name, age, height)
            this.sno = sno
        }
        inherit(Student,Person)
        Student.prototype.study=function(){
            console.log('学生在跑步');
        }
        var s1 = new Student('lyy',14,2222,23)
        console.log(s1);
        console.log(Student);
    </script>
</body>

</html>